from traceback import print_tb


class Person():
    # 定义属性
    def __init__(self,name,weight):
        self.name = name
        self.weight = weight

    # 定义方法
    def run(self):
        self.weight -= 0.1

    def eat(self):
        self.weight += 0.5

    def __str__(self):
        return f'{self.name} 体重是{self.weight}kg !'

P1 = Person('小明',60)
print(P1)

P1.run()
print(P1)

P1.eat()
print(P1)